#include"HttpServer.hpp"
#include<iostream>
#include<string>
#include<memory>
#include<ctime>

void Usage(std::string proc)
{
    std::cout<<"Usage:\n\t"<<proc<<"port"<<std::endl;
}

int main(int argc , char*argv[])
{
    //如果输入参数个数不对，则打印对应的使用方法
    if(argc!=2)
    {
        Usage(argv[0]);
        exit(4);
    }
    int port = atoi(argv[1]);

    std::shared_ptr<HttpServer> http_server(new HttpServer(port));

    http_server->InitServer();
    http_server->Loop();

    // std::cout<<time(nullptr)<<std::endl;


    return 0;
}